package org.jeecg.qis.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.qis.entity.QisProcdetailCfg;
import org.jeecg.qis.mapper.QisProcdetailCfgMapper;
import org.jeecg.qis.service.IQisProcdetailCfgService;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 过程检验配置明细表
 * @Author: shaolong
 * @Date: 2022-10-10
 * @Version: V1.0
 */
@Service
public class QisProcdetailCfgServiceImpl extends ServiceImpl<QisProcdetailCfgMapper, QisProcdetailCfg> implements IQisProcdetailCfgService {

	@Autowired
	private QisProcdetailCfgMapper qisProcdetailCfgMapper;

	@Override
	public List<QisProcdetailCfg> selectByMainId(String mainId) {
		return qisProcdetailCfgMapper.selectByMainId(mainId);
	}

	@Override
	public Result<String> edit(QisProcdetailCfg qisProcdetailCfg) {
		LambdaUpdateWrapper<QisProcdetailCfg> eq = new LambdaUpdateWrapper<QisProcdetailCfg>();
		eq.eq(QisProcdetailCfg::getRecId, qisProcdetailCfg.getRecId());
		boolean update = update(qisProcdetailCfg, eq);
		return update ? Result.ok("修改成功!") : Result.error("修改失败!");
	}
}
